<link href="/Public/Home/css/member.css" rel="stylesheet" type="text/css" media="screen" />
<script src="/Public/jquery.js"></script>
<script src="/Public/jquery.validity.js"></script>
<link href="/Public/jquery.validity.css" rel="stylesheet" type="text/css" media="screen" />
{literal}
<script>
$(function(){
		var a,b,c,d;
		$('#usernamer').blur(function(){
		var url='/index.php/Home/Login/ajaxck';
		var data={'username':$('#usernamer').val()};
		$.post(url,data,function(msg){
			if(msg=='yes'){
				$('#ac').text('*用户名不可用');
				$('#ac').attr('color','red');
				a=0;
			}else if(msg=='no'){
				$('#ac').text('用户名可使用');
				$('#ac').attr('color','green');
				a='a';
			}
		},'text');
	});
	$('#pwd').on('blur',function(event){
		if($('#pwd').val().length>16||$('#pwd').val().length<6){
			$('#pf').text('*长度不符要求');
			$('#pf').attr('color','red');
			b=0;
		}else{
			$('#pf').text('长度符合要求');
			$('#pf').attr('color','green');
			b='b';
		}
	});
	$('#rpwd').blur(function(){
		if($('#pwd').val()!=$('#rpwd').val()){
			$('#rpf').text('*密码不一致');
			$('#rpf').attr('color','red');
			c=0
		}else{
			$('#rpf').text('密码输入一致');
			$('#rpf').attr('color','green');
			c='c';
		}
	});
	$('#email').on('blur',function(){
		if($('#email').val().length==0){
			$('#emailf').text('邮箱不能为空');
			$('#emailf').css('color','red');
			d=0;
		}else{
			$('#emailf').text('邮箱格式正确');
			$('#emailf').css('color','green');
			d='d';
		}
	});
	
	$('#bt').on('click',function(event){
		var verify=a+b+c+d;
		if(verify!='abcd'){
			event.preventDefault();
		}
	});
	$('#loginButton').on('click',function(){
		var url='/index.php/Home/Login/loginck';
		var data={
			username:$('#username').val(),
			pwd:$('#password').val(),
			login:'login'
		};
		$.post(url,data,function(msg){
			if(msg=='ok'){
				window.location.href='/index.php/Home/Member/index';
			}else if(msg=='okok'){
				window.history.back();
			}else if(msg=='fail'){
				$('#log_a').text('用户名或密码错误');
				$('#log_a').css('color','red');
			}else if(msg=='illlegal'){
				$('#log_a').text('非法登录');
				$('#log_a').css('color','red');
			}
		},'text');
	});
});
</script>
{/literal}
{include file='../Public/header.tpl'}

	<div class="mainot">
		<div class="menu">当前位置: <span><a href=".">首页</a> <code>&gt;</code> 用户中心</span></div>
				<div class="logm">
			<div class="mainbt">登录后，继续操作</div>
			<div class="logregmain">
				<form id='login'>
					<div class="logregline">
						<div class="logreg_l">用户名：</div>
						<div class="logreg_r">
							<input id="username" name="username" type="text"  maxlength="100" class="input">
							<p><span id="valdateEmail">注册时的用户名</span></p>
						</div>
						<div class="clear"></div>
					</div>

					<div class="logregline">
						<div class="logreg_l">密 码：</div>
						<div class="logreg_r">
							<input id="password" name="pwd" type="password" class="input" maxlength="16">
							<p><a href="javascript:void(0);" onclick="javascript:show();" name="losepsw">忘记密码？</a></p>
						</div>
						<div id='log_a' style='text-align:center' ></div>
						<div class="clear"></div>
					</div>
					<div class="logreg_dl"><input class="buttonred" id="loginButton" name='login'  value="登 录" type="button"></div>
				</form>	
			</div>

		</div>
		<div class="regm">
			<div class="mainbt">还没帐户？注册真的很简单</div>
			<div class="logregmain">
					<form id='myform' name="formUser" action="/index.php/Home/Login/registerck" method="post">
					<div class="logregline">
						<div class="logreg_l">请填写您的用户名：</div>
						<div class="logreg_r">

							<input name="username" require='true' datatype='require' msg='不能为空' id="usernamer" maxlength="100" type="text" class="input">
							<font id='ac'></font>
						</div>
						<div class="clear"></div>
					</div>

                    <div class="logregline">
						<div class="logreg_l">请输入email地址：</div>
						<div class="logreg_r">

							<input type="text" name="email" id="email" class="input" maxlength="16">
							<font id='emailf'></font>
						</div>
						<div class="clear"></div>
					</div>

					<div class="logregline">
						<div class="logreg_l">请设定密码：</div>
						<div class="logreg_r">

							<input type="password"  name="pwd" id="pwd" class="input" maxlength="16">
							<font id='pf'></font>
						</div>
						<div class="clear"></div>
					</div>
					<!--<input type="hidden" name="redirect" value="/"/>-->
					<div class="logregline">
						<div class="logreg_l">请再次输入设定密码：</div>
						<div class="logreg_r">

							<input type="password" name="rpwd" id="rpwd"  class="input" maxlength="16">
							<font id='rpf'></font>
							<p><span id="password_notice">密码请设为6-16位字母或数字</span></p>
						</div>
						<div class="clear"></div>
					</div>
					<div class="logreg_dl">
					<input name="level" type="hidden" value="0" />
					<input name="rtime" type="hidden" value="{time()}" />
					<input name="Submit" id='bt' type="submit" value="完 成" class="buttonred">

					<!--<input name="act" type="hidden" value="act_register" >-->
					<!--<input type="hidden" name="back_act" value="./index.php" />-->
					</div>
					</form>
			</div>
		</div>
		<div class="clear"></div>
		
		
			</div>
</div>
{include file='../Public/footer.tpl'}
<!--{literal}
<script>
$(function(){
	$('#usernamer').blur(function(){
		var url='/index.php/Home/Login/ajaxck';
		var data={'username':$('#usernamer').val()};
		$.post(url,data,function(msg){
			if(msg=='yes'){
				$('#ac').text('*用户名不可用');
				$('#ac').attr('color','red');
				$('#bt').attr('disabled','disabled');
			}else if(msg=='no'){
				$('#ac').text('用户名可使用');
				$('#ac').attr('color','green');
			}
		},'text');
	});
	$('#pwd').on('blur',function(event){
		if($('#pwd').val().length>16||$('#pwd').val().length<6){
			$('#pf').text('*长度不符要求');
			$('#pf').attr('color','red');
			$('#bt').attr('disabled','disabled');
		}else{
			$('#pf').text('长度符合要求');
			$('#pf').attr('color','green');
		}
	});
	$('#rpwd').blur(function(){
		if($('#pwd').val()!=$('#rpwd').val()){
			$('#rpf').text('*密码不一致');
			$('#rpf').attr('color','red');
			$('#bt').attr('disabled','disabled');
		}else{
			$('#rpf').text('密码输入一致');
			$('#rpf').attr('color','green');
		}
	});
	$('#email').on('blur',function(){
		if($('#email').val().length==0){
			$('#emailf').text('邮箱不能为空');
			$('#emailf').css('color','red');
			$('#bt').attr('disabled','disabled');
		}else{
			$('#emailf').text('邮箱格式正确');
			$('#emailf').css('color','green');
		}
	});
	
	$('#bt').on('click',function(){
		if($('.logregmain :input').val().length==0){
			$('#bt').attr('disabled','disabled');
		}
	});
});
</script>
{/literal}-->